<?php

/**
 +----------------------------------------------+
 * PHP Version 5.2.10                           *
 +----------------------------------------------+
 * 功能说明：处理[mail].*[/mail]的类
 +----------------------------------------------+
 * Author    ：九九                             *
 * QQ        ：405494897                        *
 * Email     ：xjiujiu@foxmail.com              *
 * Copyright ：2010/7/23                        *
 +----------------------------------------------+ 
**/

/**
* @name  mailUBBCode class
* 
*/
class mailUBBCode extends UBBCode{
    private $mailAddress;
    public function __construct($content,$value,$UBBCode,$regExp){
        parent::__construct(&$content,$value,$UBBCode,$regExp); 
        $this->mailAddress  = null;
        $this->htmlCode     = "<a href=\"mailto:{$this->value}\"/>\\1</a>";
    }
    public function replaceUBBCode(){        
        //$this->mailAddress  = self::ConactStr(self::pregSplit($this->UBBCode));
        //$this->htmlCode     = preg_replace("/{mailAddress}/i",$this->mailAddress,$this->htmlCode); 
        if(($this->content  = preg_replace($this->regExp,$this->htmlCode,$this->content,1)) == true){
            return true;
        }else{
            return false;
        }        
    }
}


?>